﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BaMusaSoft.RPS.ViewModel;
using BaMusaSoft.RPS.DataModel;
using BaMusaSoft.RPS.View.Services;

namespace BaMusaSoft.RPS.View
{
    /// <summary>
    /// Interaction logic for ContractView.xaml
    /// </summary>
    public partial class ContractView : UserControl
    {
        //ContractViewModel vm;
        public ContractView()
        {
            InitializeComponent();
        }

        private void ViewLoaded(object sender, RoutedEventArgs e)
        {
            //vm = (ContractViewModel)DataContext;
            //vm.AddActivityRequest += new EventHandler<NotificationEventArgs<bool, ContractActivity>>(AddActivityRequest);
            //vm.AskQuestion += new EventHandler<NotificationEventArgs<string, bool>>(Helper.AskQuestionEvent);
            //vm.MessageNotification += new EventHandler<NotificationEventArgs>(Helper.MessageNotificationEvent);
            //ttt.Focus();

        }

        //void AddActivityRequest(object sender, NotificationEventArgs<bool, ContractActivity> e)
        //{
        //    //if (e.Data)
        //    //{
        //    //    ContractActivityViewModel activityViewModel = new ContractActivityViewModel();
        //    //    AddActivityWindow addActivityWindow = new AddActivityWindow(activityViewModel);
        //    //    addActivityWindow.Closed += (s, ea) =>
        //    //    {
        //    //        if (addActivityWindow.DialogResult == true)
        //    //        {
        //    //            var activity = addActivityWindow.Activity.Activity;
        //    //            e.Completed(activity);
        //    //        }
        //    //    };
        //    //    addActivityWindow.ShowDialog();
        //    //}

        //}
        private void ViewUnloaded(object sender, RoutedEventArgs e)
        {
            //vm.AddActivityRequest -= AddActivityRequest;
            //vm.AskQuestion -= Helper.AskQuestionEvent;
            //vm.MessageNotification -= Helper.MessageNotificationEvent;
        }

    }
}
